
//creates the ad_request_done function based on variables passed in based on the type of ad
function google_ad_request_done(google_ads){
	
	var s = '';
	var i;
	
	if (google_ads.length == 0) {
	return;
	}
	
	//extra positioning
	if(position == "middle"){s += '<div class="clear-block"></div><br>';}
	
  //Ads by google
  if(abg != false && google_ads[0].type != "image"){
		s += '<a href=\"' + google_info.feedback_url + '\" target="_blank" class="adsense' + position + vertads + 'abg">Ads by Google</a><br>';
  }

	//if we are doing non text ads
	if(custadtype == "any"){
		
		if (google_ads[0].type == "flash") {
			
		  s += '<br><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
			' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' +
			google_ad.image_width + '" HEIGHT="' +
			google_ad.image_height + '"> <PARAM NAME="movie" VALUE="' +
			google_ad.image_url + '">' +
			'<PARAM NAME="quality" VALUE="high">' +
			'<PARAM NAME="AllowScriptAccess" VALUE="never">' +
			'<EMBED src="' +
			google_ad.image_url + '" WIDTH="' +
			google_ad.image_width + '" HEIGHT="' +
			google_ad.image_height +
			'" TYPE="application/x-shockwave-flash"' +
			' AllowScriptAccess="never" ' +
			' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
			if(position == "middle"){s += '<div class="clear-block"></div><br>';}
			
		} else if (google_ads[0].type == "image") {
			
			s += '<br> <a href="' +
			google_ads[0].url + '" title="go to ' +
			google_ads[0].visible_url + '" target="_blank" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[0].visible_url + '\';return true"><img border="0" src="' +
			google_ads[0].image_url + '"width="' +
			google_ads[0].image_width + '"height="' +
			google_ads[0].image_height + '"></a>';
			if(position == "middle"){s += '<div class="clear-block"></div><br>';}
			
		} else if (google_ads[0].type == "html") {
			
			s += '<br>' + google_ads[0].snippet;
			if(position == "middle"){s += '<div class="clear-block"></div><br>';}
		}
	}

  //Ads by google
	if(position == "homepage"){
		if(google_ads[0].type == "image"){
		  s += '<a href=\"' + google_info.feedback_url + '\" target="_blank" class="adsenseabgimage adsense' + position + 'abgimage">Ads by Google</a>';
    }
	}
	
	//if we are doing an image only
	if(custadtype == "image"){
			
		if (google_ads[0].type == "image") {
			
			s += '<br> <a href="' +
			google_ads[0].url + '" target="_blank" title="go to ' +
			google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[0].visible_url + '\';return true"><img border="0" src="' +
			google_ads[0].image_url + '"width="' +
			google_ads[0].image_width + '"height="' +
			google_ads[0].image_height + '"></a>';
			if(position == "middle"){s += '<div class="clear-block"></div><br>';}
			
		}
	}	
	
  //Ads by google
	if(position != "homepage"){
		if(google_ads[0].type == "image"){
		  s += '<a href=\"' + google_info.feedback_url + '\" target="_blank" class="adsenseabgimage adsense' + position + 'abgimage">Ads by Google</a><br>';
    }
	}


	if(vertads == "vertads"){	s += '<br>'; }
	
	if(google_ads[0].type == "text"){
		if (google_ads.length > 0) {
				
			for(i = 0; i < google_ads.length; ++i) {
				
				if(position == "middle"){s += '<div class="adsensevertcol' + vertads + '">';}

				if(vertads == "vertads"){
					s += '<a class="adsensebiglink" href="' +
					google_ads[i].url + '" onmouseout="window.status=\'\'" target="_blank" onmouseover="window.status=\'go to ' +
					google_ads[i].visible_url + '\';return true"> <span class="adsense' + position + 'line1"> <b>' +
					google_ads[i].line1 + '</b></span></a> <span class="adsense' + position + 'line2">&nbsp;' +
					google_ads[i].line2 + '&nbsp;' +
					google_ads[i].line3 + '&nbsp;</span> <a href="' +
					google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
					google_ads[i].visible_url + '\';return true"> <span class="adsense' + position + 'line3">' +
					google_ads[i].visible_url + '</span></a><div class="clear-block"></div>';
				}
				else{
					s += '<br><a class="adsensebiglink" href="' +
					google_ads[i].url + '" onmouseout="window.status=\'\'" target="_blank" onmouseover="window.status=\'go to ' +
					google_ads[i].visible_url + '\';return true"> <span class="adsense' + position + 'line1"> <b>' +
					google_ads[i].line1 + '</b><br></span></a> <span class="adsense' + position + 'line2">' +
					google_ads[i].line2 + '&nbsp;' +
					google_ads[i].line3 + '<br></span> <a class="adsensebiglink" href="' +
					google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
					google_ads[i].visible_url + '\';return true"> <span class="adsense' + position + 'line3">' +
					google_ads[i].visible_url + '</span></a><br>';
				}
				
				if(position == "middle"){s += '</div>';}
				
			}
			if(position == "middle" || position == "vidpagebelowtitle"){s += '<div class="clear-block"></div><br>';}
		}
	}
	
  document.write(s);
  return;
}

google_ad_client = 'pub-7579606133989673';
google_ad_output = 'js';
google_feedback = 'on';

//set the channel
if(channel){
	google_ad_channel = channel;
} else { google_ad_channel = ''; }

//set the number of ads
google_max_num_ads = numads;

//if we have a size variable we need to set the google variable
if(size){
	google_image_size = size;
} else { google_image_size = ''; }

//if we have hints we need to specify them
if(hints){
	google_hints = hints;
} else { google_hints = ''; }

if(trackingcode){
	google_trackingcode = trackingcode;
} else{ google_trackingcode = ""; }

//if we have a skip variable we have to set google to skip
if(vertads){
	vertads = "vertads";
} else { vertads = ""; }

//if we have a skip variable we have to set google to skip
if(skip){
	google_skip = skip;
} else { google_skip = ''; }

//if this is not a text only ad we have to set that up
if(custadtype == "any"){
    google_ad_type = 'text,image,flash,html';
} else if(custadtype == "textonly") {
    google_ad_type = 'text';
} else if(custadtype == "image") {
    google_ad_type = 'image';
} else{
    custadtype == "any";
    google_ad_type = 'text,image,flash,html';
}

//call the ads
document.write('<script language="JavaScript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>'); 
